package com.bite.springmvc.controller;

import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hello/v1")
public class HelloController {

    @RequestMapping("/hello/v2")
    public String hello(){
        return "hello spring mvc";
    }
    //仅支持get&post请求
//    @RequestMapping(value = "/hello2",method = RequestMethod.GET)
    @RequestMapping(value = "/hello2",method = {RequestMethod.GET, RequestMethod.POST})
    public String hello2(){
        return "hello spring mvc";
    }

    @GetMapping("/hello3")
    public String hello3(){
        return "hello spring mvc 3 ";
    }

//    @GetMapping("/hello3")
//    public String hello5(){
//        return "hello spring mvc 5 ";
//    }

    @PostMapping("/hello4")
    public String hello4(){
        return "hello spring mvc  4";
    }
}
